import Manager from './Manager';
export default class Cursor {
    x = 0;
    y = 0;
    constructor() {
        this.manager = new Manager()
        this.sizes = this.manager.sizes;
        this.camera = this.manager.camera;
        this.time = this.manager.time;

        window.addEventListener("mousemove", (event) => {
            this.x = event.clientX / this.sizes.width - 0.5;
            this.y = event.clientY / this.sizes.height - 0.5;
        });
    }

    update() {

        // this.camera.perspectiveCamera.position.y = (-this.manager.scroll.scrollY / this.sizes.height) * this.manager.cube.objectsDistance

        const parallaX = this.x * 0.5;
        const parallaY = -this.y * 0.5;

        this.camera.cameraGroup.position.x += (parallaX - this.camera.cameraGroup.position.x) * 5 * this.time.deltaTime;
        this.camera.cameraGroup.position.y += (parallaY - this.camera.cameraGroup.position.y) * 5 * this.time.deltaTime;
    }


}